<template>
  <div style="width:100%;background-color:#fff;">
    <div class="container">
      <div class="w100 report flex-al">
        <div class="box flex-al al-start">
          <div class="w100 flex-row j-sb al-start">
            <!-- <build-el-h1 name="大赛报道标题.png" type="1"></build-el-h1> -->
            <div class="my-title">奖项公示</div>
          </div>
          <div class="w100" v-if="tableData.length != 0">
            <build-el-report-list
              v-for="item in tableData"
              :key="item.newsId"
              :title="item.title"
              @handNes="handNes(item.newsId, item)"
              :update-time="item.updateTime"
            ></build-el-report-list>
          </div>
          <div class="no-data" v-else>暂无数据</div>
        </div>

        <el-pagination
          v-margin-top="'10px'"
          background
          :page-size="pageSize"
          :current-page="pageNow"
          layout="prev, pager, next"
          @current-change="changePage"
          :total="total"
        ></el-pagination>
      </div>
      <div v-margin-top="'30px'"></div>
    </div>
  </div>
</template>
<script>
import buildElBread from "@/components/build-el-bread";
import buildElReportList from "@/components/build-el-report-list";
import buildElH1 from "@/components/build-el-h1";
export default {
  components: {
    buildElBread,
    buildElReportList,
    buildElH1
  },
  data() {
    return {
      tableData: null,
      total: 0,
      pageSize: 15,
      pageNow: 1
    };
  },
  async created() {
    await this.init(1);
  },
  methods: {
    handNes(id, item) {
      if (item.pcJumpLink) {
        window.open(item.pcJumpLink);
      } else if (item.mobileJumpLink) {
        window.open(item.mobileJumpLink);
      } else {
        this.toPage(id);
      }
      console.log("www", id);
    },
    async init(page) {
      this.tableData = [];
      let tableData = await this.api.selectNewsList7(page, this.pageSize);
      this.total = tableData.total;
      this.tableData = tableData.list;
      console.log("tableData", this.tableData);
    },
    changePage(e) {
      this.pageNow = e;
      this.init(e);
    }
  }
};
</script>
<style lang="less" scoped>
html {
  background: #eee;
}
.report {
  background: #fff;
  // height: 1000px;
}
</style>
